
const Router=require("koa-router")
const {visitorfily}=require("../middleware/usermiddleware")

const {create,reply,update,remove,getComment,getDetail}=require("../controller/comment_controller")
const {auto,verifyAuth,getPower}=require("../middleware/automiddleware")
const { updateContent } = require("../service/AuthService")

const router=new Router({prefix:"/comment"})
//登录后验证token才能发表评论
router.post("/",verifyAuth,create);
//对评论做出评论
router.post("/:commentid/reply",verifyAuth,reply)
//修改评论 用户必须登录 必须验证权限
router.patch("/:commentid",verifyAuth ,getPower,update)
//删除评论
router.delete("/:commentid",verifyAuth,getPower,remove);
//查看评论
 router.get("/",getComment)
//查看详情
router.get("/:momentid",getDetail)
module.exports=router;
 